Many electronic devices include embedded processors, which operate on the basis of program data supplied thereto. The devices therefore include means for storing the program data. Typically, the means for storing the program data is a read-only memory (ROM), as this is typically the most efficient type of storage available.
However, storing the program data entirely on ROM has the disadvantage that the system becomes inflexible, in that it is not possible to update or correct the stored program data.
U.S. Pat. No. 5,592,613 discloses a microprocessor with a program memory and a program correction circuit. The program correction circuit includes an electrically programmable nonvolatile memory for storing address data and correction program data. The stored address data denote the addresses in the program memory where the stored program data is to be replaced by the correction program data.
However, this has the disadvantage that each address supplied to the system must be compared with the address data stored in the nonvolatile memory, which can compromise the speed of the processor.
U.S. Pat. No. 4,751,703 discloses a method of storing the control code for a processor, using a ROM, as well as a read/write memory (in the form of a random access memory RAM) which includes a code area and a patch area. Thus, the control code is virtually divided into a number of blocks, with the first instruction of each block stored in the code area of the RAM, and the subsequent instructions of each block stored in the ROM. When it is determined that a block of code contains an error, the first instruction of that block, stored in the RAM, can be replaced by a branch instruction, which causes subsequent instructions to be read from the patch area of the RAM. The patch can then be stored in the RAM, with the final instruction of the patch returning the control to the previous control code.
However, this system has the disadvantage that the RAM needs to be addressed once in each block of code, which is relatively inefficient when there are no corrections to implement.